Data Layout for Recovery and Durability

ABSTRACT

A Metadata server described herein is configured to generate a metadata table optimized for data durability and recovery. In generating the metadata table, the metadata server associates each possible combination of servers with one of the indices of the table, thereby ensuring that each server participates in recovery in the event of a server failure. In addition, the metadata server may also associate one or more additional servers with each index to provide added data durability. Upon generating the metadata table, the metadata server provides the metadata table to clients or servers. Alternatively, the metadata server may provide rules and parameters to clients to enable those clients to identify servers storing data items. The clients may use these parameters and an index as inputs to the rules to determine the identities of servers storing or designated to store data items corresponding to the index.

RELATED APPLICATIONS

This U.S. patent application is a continuation-in-part patent application of co-pending prior application Ser. No. 12/763,107, entitled “Locator Table and Client Library for Datacenters,” and of co-pending prior application Ser. No. 12/763,133, entitled “Memory Management and Recovery for Datacenters.” Both co-pending prior applications were filed on Apr. 19, 2010. This U.S. patent application is also a continuation-in-part patent application of co-pending prior application Ser. No. 13/017,193, entitled “Parallel Serialization of Request Processing” and filed on Jan. 31, 2011. U.S. application Ser. Nos. 12/763,107, 12/763,133, and 13/017,193 are hereby incorporated by reference in their entirety herein.

BACKGROUND

Distributed data storage systems, such as those used in cloud computing environments, often rely on a metadata server to identify which servers store what data. This metadata server typically maintains a large metadata table mapping identifiers associated with data to the servers that store the data. Because of the large number of data units distributed among the storage servers, this metadata table can often be quite large. Also, to ensure durability of the data, data items are often stored across a plurality of server replicas. Metadata tables, then, often must identify a multiple servers for each data item identifier, greatly increasing the metadata table size. This large size makes it impractical to transmit the metadata table to the clients that will use the metadata table to identify servers. The other alternative is equally problematic: many servers frequently requesting server identifications from the single metadata server, thereby introducing congestion.

Besides these difficulties, metadata tables often suffer from poor durability and poor distribution of data among the servers. Servers are often assigned to data items in a naïve manner, allowing a single or dual server failure to cause permanent data loss even when three server replicas are assigned to a data item. Also, these naïve groupings often result in sub-optimal performance during recovery in the event of server failure, with only a small subset of the available servers participating in the recovery.

SUMMARY

A metadata server described herein is configured to generate a metadata table optimized for data durability and recovery. In generating the metadata table, the metadata server associates each possible pair of servers with one of the indices of the table, each index associated with one or more data items. By utilizing each possible pair of servers, the metadata server ensures that every server participates in recovery in the event of a server failure. Additionally, the metadata server may, for sizes of combinations greater than two, associate each possible combination of servers with one of the indices of the table. In addition to associating combinations of servers to each index, the metadata server may also associate one or more additional servers with each index to provide added data durability. Upon generating the metadata table, the metadata server provides the metadata table to clients or servers for use in performing operations related to data items stored by the servers and corresponding to table indices.

In place of the metadata table, the metadata server may instead provide rules and parameters to clients to enable those clients to identify servers storing data items. The rules may define a virtual metadata table and the parameters may include the total number of servers in the system and the number of servers associated with each index. The clients may use these parameters and an index as inputs to the rules to determine the identities of servers storing or designated to store data items corresponding to the index.

This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

The detailed description is set forth with reference to the accompanying figures, in which the left-most digit of a reference number identifies the figure in which the reference number first appears. The use of the same reference numbers in different figures indicates similar or identical items or features.

FIG. 1 illustrates an example environment in which metadata tables or rules are used by clients to identify servers associated with data items, in accordance with various embodiments.

FIG. 2 illustrates an example metadata table that includes each possible pair of servers assigned to one of the indices of the table and one or more additional servers assigned to each of the indices, in accordance with various embodiments.

FIG. 3 illustrates an example metadata table that includes each possible triplet of servers assigned to one of the indices of the table, in accordance with various embodiments.

FIG. 4 illustrates a flowchart of example operations for generating a metadata table and for providing that metadata table to clients or servers, in accordance with various embodiments.

FIG. 5 illustrates a flowchart of example operations for utilizing one or more rules defining a virtual metadata table to identify servers associated with an index that corresponds to one or more data items, in accordance with various embodiments.

FIG. 6 illustrates a block diagram showing an example system architecture for a computer system such as a metadata server, a client or a server, in accordance with various embodiments.

DETAILED DESCRIPTION

Described herein are techniques for generating a metadata table or utilizing rules in place of the metadata table by devices of a system. Those devices may include a metadata server, servers, and one or more clients. The metadata server may be configured to generate the metadata table for use by the clients or servers or to provide the rules and rule parameters to the clients or servers.

The metadata server may generate a metadata table that ensures durability of the data stored on servers of the system by associating an index corresponding to one or more data items with a predetermined number of servers, the predetermined number of server acting as replicas of each other with respect to the one or more data items corresponding to the index. The metadata server may also ensure that the metadata table associates each server with each of the other servers so that, in the event of server failure, all servers participate in recovery. In some embodiments, the metadata server also ensures that each possible combination of servers constituting a set of server replicas associated with an index in the metadata table is a unique combination with respect to the other possible combinations. Also, in some embodiments, each server is associated with a failure domain and the metadata server only combines a given server with other servers that are not in its failure domain in constructing the set of server replicas for an index. Upon generating the metadata table, the metadata server provides the metadata table to the clients, servers, or both for use in determining the servers that store or are designated to store one or more data items.

In various embodiments, a client of the system may use one or more rules in place of the metadata table. The rules may define a virtual metadata table that need not be constructed but which may provide identities of servers through the rules. The client may be configured with the rules or provided with the rules by the metadata server. In such embodiments, the client may also receive parameters from the metadata server, including the total number of servers in the system and the number of server replicas to be associated with an index. In one embodiment, the parameters may also include at least one of server failure domains or a pseudo-random seed. The client may use these parameters as inputs to the rules. In response to inputting an index corresponding to one or more data items along with the parameters into the rules, the client receives the identities of servers associated with the index in the virtual metadata table defined by the rules. In response to the failure of a server, the client may receive one or both of updated rules or updated parameters from the metadata server. Alternatively, the client may be notified of the server failure by the metadata server and use the rules to determine identities of replacement servers for the failed server.

As mentioned, each index may be associated with one or more data items. These data items may be of any type, size, or grouping. In some embodiments, data items may be stored as units of data called “tracts.” Tracts may have a predetermined same or similar size, such as one megabyte, and represent the smallest unit of data that can be read from or written to a storage unit that optimizes performance. For example, on a mechanical device, such as a disk, the tract size would be large enough to avoid to giving up performance due to the lost opportunity of reading more data “for free” after a seek or rotational delay. As a second example, on a medium such as flash, the tract size would be calculated based on the chip bandwidth and characteristics of the flash storage medium. Each tract belongs to a byte sequence, each byte sequence being comprised of multiple tracts distributed across multiple servers of the system to enable more efficient reading from and writing to the tracts. In such embodiments, the metadata table may be a “tract locator table” that may be used by clients for reading from and writing to tracts, as well as for identifying servers storing metadata for byte sequences. Also, in such embodiments, the index may be a prefix taken from a fixed length translation, such as a hash, of a tract identifier. Alternatively, the index may be the remainder of a mod operation that divides one of the prefix, the hash, or the tract identifier for a tract by the number of indices used in the tract locator table.

Tracts, byte sequences, tract locator tables, and their uses are described in greater detail in U.S. patent application Ser. No. 12/763,107, entitled “Locator Table and Client Library for Datacenters” and filed on Apr. 19, 2010, U.S. patent application Ser. No. 12/763,133, entitled “Memory Management and Recovery for Datacenters” and filed on Apr. 19, 2010, and U.S. patent application Ser. No. 13/017,193, entitled “Parallel Serialization of Request Processing” and filed on Jan. 31, 2011. These applications are incorporated by reference above in “Related Applications.”

While FIG. 1 below illustrates an example environment in which the metadata table is a tract locator table and the data items are tracts, it is to be understood that the metadata table generation and rule utilization techniques described herein are in no way limited to tracts and tract locator tables.

Example Environment

FIG. 1 illustrates an example environment in which metadata tables or rules are used by clients to identify servers associated with data items, in accordance with various embodiments. As illustrated, a system 100 includes a metadata server 102 configured to provides a metadata table or rules 104 to at least one of clients 106 or servers 108 of the system 100. The metadata server 102 includes a metadata table generation module 110 configured to generate a metadata table 104 based at least on table data 112 of the metadata server 102 and a transmission module 114 configured to transmit the metadata table 104 to the clients 106 or servers 108. Alternatively or additionally, the transmission module 114 may be configured to transmit at least one of rules 104 or parameters included in the table data 112 to the clients 106 or servers 108. The clients 106 and servers 108 may each include a virtual table module 116 to utilize rules and parameters to identify servers 108 that are storing or are designated to store data items. The clients 106 may also each include a client library 118 configured to formulate and transmit metadata requests 120 or read/write requests 122 to servers 108 identified using the metadata table or rules 104. These requests 120 and 122 may relate to data 124 stored in storage 126 of the servers 108 or to data sequences of data 124 stored across a plurality of servers 108. The servers 108 may be configured to provide responses 128 to the requests 120 and 122.

In various embodiments, the metadata server 102, clients 106, and servers 108 may each be any sort of computing device or computing devices. For example, the metadata server 102, clients 106, and servers 108 may each be or include a personal computer (PC), a laptop computer, a server or server farm, a mainframe, a work station, or any other sort of device or devices. In one implementation, the metadata server 102, clients 106, and servers 108 represent a plurality of computing devices working in communication, such as a cloud computing network of nodes. When implemented on multiple computing devices, the metadata server 102, a client 106, or a server 108 may distribute the modules and data of the metadata server 102, the client 106, or the server 108 among the multiple computing devices. In some implementations, the metadata server 102, a client 106, or a server 108 represents one or more virtual machines implemented on one or more computing devices. The nature and functions of the modules and data of the metadata server 102, clients 106, and servers 108 are described further herein. An example metadata server 102, client 106, or server 108 is illustrated in FIG. 6 and is described below in greater detail with reference to that figure.

In some embodiments, each server 108 may be associated with a storage node of a computing device. In such embodiments, a computing device may include multiple servers 108, one for each storage device.

In further embodiments, servers 108 may be virtual servers. In such embodiments, virtual servers may be logical representations of servers 108, with multiple virtual servers assigned to a single actual server 108 by a table or other data structure storing virtual server-server 108 mappings. Alternatively, virtual servers may correspond to virtual machine implementations of servers 108.

In various embodiments, servers 108 belong to failure domains. Each failure domain defines one or more servers 108 that are likely to fail together, such as servers 108 sharing a rack or a computing device. Mappings of servers 108 to their failure domains may be stored by a device of the system 100, such as the metadata server 102.

In some embodiments, a network or networks may connect the metadata server 102, clients 106, and servers 108. The network or networks may be any type of networks, such as wide area networks (WANs), local area networks (LANs), or the Internet. Also, the network or networks may be public, private, or include both public and private networks. Further, the network or networks may be wired, wireless, or include both wired and wireless networks. The network or networks may utilize any one or more protocols for communication, such as the Internet Protocol (IP), other packet based protocols, or other protocols. Additionally, the network or networks may comprise any number of intermediary devices, such as routers, base stations, access points, firewalls, or gateway devices.

In various embodiments, the metadata table 104 may be any sort of data structure or data structures of any program or programs. For example, the metadata table 104 may include rows corresponding to indices of the metadata table 104 and columns corresponding to server replicas 108. Each index corresponds to one or more data items and the server replicas 108 associated with that index are the server replicas 108 storing or designated to store the one or more data items. Each intersection of a row and column, then, represents a server replica 108 that stores one or more data items corresponding to an index. In other embodiments, the rows and columns may be reversed, with columns corresponding to indices and rows to server replicas. In one embodiment, the metadata table 104 comprises two tables: a failure domain table and an intra-domain table. The failure domain table would replace server replica columns with failure domain columns, associating an index with multiple failure domains. The intra-domain table would then associate specific server replicas 108 within those failure domains with the indices. Example metadata tables 104 are illustrated in FIGS. 2 and 3 and are discussed further herein with reference to those figures.

As mentioned above, the metadata table 104 may be generated by the metadata table generation module 110. In some embodiments, the metadata table generation module 110 utilizes the table data 112 and one or more rules to generate the metadata table 104. For example, one set of rules may determine the number of possible pairs of server replicas 108 and generate at least as many indices as that number of pairs. Each possible pair is then associated with one of the indices, resulting in a two column table with at least as many rows as the number of possible pairs. That table may then be supplemented with one or more additional columns of server replicas to provided added data durability. Server replicas 108 associated with indices in these additional columns may be selected randomly or pseudo-randomly. In another example, the metadata table generation module 110 may utilize another set of rules to determine the number of possible combinations of server replicas, the combinations having a specified length, such as three, four, or five servers. The number of indices in the metadata table 104 is then set to at least this possible number of combinations, and each possible combination is associated with one of the indices. An example method of generating the metadata table 104 is shown in FIG. 4 and is described further herein with reference to that figure.

In various embodiments, table data 112 may comprise any collection of data stored in one or more files or forms. Table data 112 may include the number of servers 108 in the system 100, failure domain-server mappings, such as those mentioned above, a targeted durability of the data stored in the system 100, a targeted number of server replicas 108 to be associated with each index in the metadata table 104, a mapping of virtual servers to servers 108, a pseudo-random seed for selecting server replicas 108 for indices, indications of failed servers 108, and one or more rules 104 defining a virtual metadata table, the rules 104 to be provided to clients 106 or servers 108. Any one or more items of the table data 112 may be used by the metadata table generation module 110 and the transmission module 114 in performing their respective operations.

In some embodiments, the transmission module 114 transmits the metadata table or rules 104 to clients 106 or servers 108. The transmission module 114 may also transmit parameters for rules 104, such the data stored in table data 112. The metadata table or rules 104 may be transmitted on initiative of the metadata server 102 or in response to a request from a client 106 or a server 108. The transmission may also be event driven, with the transmission module 114 transmitting an updated metadata table 104, updated rules 104, or updated parameters for rules 104 to clients 106 and servers 108 response to a server failure. The use of rules 104 in place of a metadata table 104 may be decided on a system level, with all devices of the system 100 using the same rules 104 or same metadata table 104. Alternatively, the transmission module 114 may transmit rules 104 to some clients 106 or servers 108 and metadata tables 104 to other clients 106 or servers 108. In such embodiments, however, the metadata table 104 will have been generated using the rules 104, ensuring that all devices of the system 100 are using a common reference. The transmission module 114 may be configured to provision the metadata tables 104 and/or rules 104 accordingly based on what scheme is used.

The clients 106 and servers 108 may store the metadata table or rules 104 upon reception. In some embodiments, the clients 106 and servers 108 are configured with the rules 104 and receive only the parameters from the metadata server 102. In embodiments in which clients 106 and servers 108 are configured with rules 104 or receive rules 104, the virtual table modules 116 of the clients 106 and servers 108 may utilize the rules 104 and parameters to answer requests for identifications of server replicas 108. Such requests may be received, for example, from the client library 118. The requests may provide an index and, optionally an identification of a specific server replica 108 (e.g., the first server replica 108 for that index). If an index alone is specified, all server replicas 108 for that index are determined and returned. If a specific server replica 108 is requested, that server replica 108 alone may be identified and returned. Examples of rules used to identify servers based on indices and parameters are described below with reference to FIG. 5, which illustrates a number of example operations of a virtual table module 116. In addition to identifying servers, the rules 104 may be used to identify replacement server replicas 108 in the event of a server failure.

In various embodiments, the client library 118 may be a component of client 106 configured to perform operations relating to data items and sets of data items, such as the above described tracts and byte sequences. The client library 118 determines or receives identifiers of byte sequences or tracts and uses those identifiers to generate one or more indices to the metadata table or rules 104. As mentioned above, the client library 118 may perform a fixed length translation, such as a hash, on the identifier and take as a prefix a subset of the bits resulting from the fixed length translation, using that prefix as an index. Alternatively, the client library 118 may perform a mod operation on the prefix, fixed length translation, or identifier, dividing by the number of indices used in the metadata table 104 or by the rules 104. The client library 118 may determine the number of indices by querying the metadata table 104 or by asking the virtual table module 116 to provide the number of indices. The use of fixed length translations or mod operations may ensure that the tracts comprising a byte sequence are uniformly or nearly uniformly distributed across a plurality of servers 108. Upon generating the index or indices, the client library 118 may look up the server replicas 108 associated with that index or those indices in the metadata table 104. Alternatively, the client library 118 may request that the virtual table module 116 identify the server replicas 108 and may include the index or indices in the request.

In some embodiments, the client library 118 may have received a request from a client application to create, delete, or write to a byte sequence. Using an identifier associated with the byte sequence, the client library 118 determines server replicas 108 storing byte sequence metadata. The client then transmits metadata requests 120 to the identified server replicas 108. The metadata request 120 may seek the creation or deletion of a byte sequence or the allocation of one or more tracts of a byte sequence for the client library 118 to write to. The servers 108 may provide responses 128 indicating the success or failure of these metadata requests 120 and, if tracts are allocated, provide identifiers of those tracts. Provided tract identifiers may then be used by the client library 118 to identify server replicas 108 designated to store those tracts.

Also, in some embodiments, the client library 118 may have received a request from a client application to read from or write to a byte sequence or specific tracts of a byte sequence. Using identifiers associated with the tracts, the client library 118 determines the server replicas 108 storing the tracts. If the write request is for writing to a new tract, the client library 118 first issues a metadata request 120, as described above, to receive a tract allocation. Once server replicas 108 storing or designated to store all tracts to be read from or written to are identified, the client library 118 makes read or write requests 122 to the server replicas 108. Read requests 122 may initially be made of a single server replica 108, with use of the others only being made when a response 128 is not returned. Write requests 122 may be made in parallel of the identified server replicas 108. The response 128 to a read request 122 returns a tract if the request 122 is successful. The response 128 to a write request 122 indicates success or failure of the request 122.

In some embodiments, a server failure may be detected by the client library 118. For example, a server replica 108 may not respond to a request 120 or 122 in a certain amount of time. Upon detecting failure, the client library 118 may request an updated metadata table 104 from the metadata server 102 and notify the metadata server 102 of the failure. Alternatively, the client library 118 may request identification of a recovery server replica 108 from the virtual table module 116.

In various embodiments, servers 108 may utilize the metadata table or rules 104 to determine which indices they are associated with. Knowing these indices may enable the servers 108 to validate metadata requests 120 and read/write requests 122, ensuring that it is the appropriate server 108 for the requests 120/122 and providing a negative response if it is not the appropriate server 108. The server 108 may also utilize the metadata table or rules 104 to determine which servers 108 are replicas for a given index that the server 108 is associated with. In alternative embodiments, servers 108 may not receive or utilize the metadata table or rules 104, relying on clients 106 to correctly identify servers 108 and receiving identifications of their replicas in requests 120/122 from the clients 106.

In some embodiments, the data 124 stored in storage 126 of the servers 108 comprises the above-described tracts. A single storage unit 126 of a server 108 may store data/tracts 124 from a plurality of byte sequences, the tracts 124 of a given byte sequence being distributed among a plurality of the servers 108. In other embodiments, data 124 may comprise other types of data of differing sizes. The storage 126 of each server 108 may actually be multiple storage units, as described above. Example storage units 126 can include system memory, removable storage, and non-removable storage. Such system memory, removable storage, and non-removable storage units are illustrated in FIG. 6 and are described further herein with reference to that figure.

Example Metadata Tables and Techniques for Their Generation

FIG. 2 illustrates an example metadata table that includes each possible pair of servers assigned to one of the indices of the table and one or more additional servers assigned to each of the indices, in accordance with various embodiments. As illustrated in FIG. 2, the metadata table 104 may include a plurality of indices 202. The indices 202 may be binary numbers taken as prefixes from fixed length translations, as discussed above, or integers resulting from mod operations. The indices 202 of FIG. 2 are three bit binary numbers. These three bit binary number indices are provided for the sake of illustration, and it is to be understood that binary numbers of any bit length or integers may be used instead. The indices 202 include each possible index given the type, length, or number of the indices. For example, if three bit binary numbers are used, the metadata table 104 will include eight indices 202 (two to the power of the bit length, three). Each index 202 is unique with respect to the other indices 202, ensuring that all possible indices 202 given certain criteria are included in the metadata table 104. In another example, if forty indices are targeted (based on operator plans, etc.), the indices 202 may include each integer from zero to thirty-nine, those integers representing results of mod operations performed using the targeted number of indices 202.

To ensure full participation of the servers 108 in recovery in the event of a failed server 108, each possible pair of servers 108 is determined and associated with an index 202. These server pairs are associated with an index 202 in the metadata table 104 by placing representations of the servers 108 belonging to the pair in the first server replica column 204 and the second server replica column 206. In other embodiments, other columns of the metadata table 104 may be used. Also, in some embodiments, the number of possible pairs may be taken into account when selecting the number of indices 202.

To ensure durability of the data items corresponding to the indices 202, a third server replica column 208 is added to the metadata table 104. While only a third column 208 is shown in FIG. 2, additional columns may be included for additional durability if desired. The servers 108 represented in this column 208 may be selected randomly, pseudo-randomly, or in some other manner.

The server representations shown at the intersection of each row and column may be any sort of representation. The representations may be addresses of the servers 108, such as Internet Protocol (IP) addresses. Alternatively, the server representations may be some other representation smaller than an IP address in order to minimize the size of the metadata table 104. As shown in FIG. 2, these smaller representations may be integers such as zero, one, two, three, etc. To determine the smaller representations, another table associating server IP addresses with smaller representations may be used. In some embodiments, each server 108 appears represented in the metadata table 104 approximately the same number of times. Also, no server 108 is represented more than once in any given row.

FIG. 3 illustrates an example metadata table that includes each possible triplet of servers assigned to one of the indices of the table, in accordance with various embodiments. FIG. 3 differs from FIG. 2 both in the use of triplet combinations rather than pair combinations and in the use of integers as indices 302. As mentioned above, the number of integer indices 302 may be selected based on a targeted number of indices 302. The targeted number of indices 302 may in turn be determined by the number of combinations. In FIG. 3, representations for five servers 108 appear. The number of possible triplet combinations of those five servers 108 is ten. Accordingly, ten indices 302 zero through nine are used in the metadata table 104 of FIG. 3.

Associated with each index 302 are three server representations in the three columns 304-308. These three server representations associated with a given index 302 represent servers from one of the possible triplet combinations. Because no server 108 appears more than once in any triplet combination, no server representation appears more than once in a row corresponding to a given index. Because triplet combinations rather than pair combinations are used, it may be determined that no additional columns including additional server replicas 108 are needed for data durability. A metadata table 104 including all possible triplet combinations is likely to have a larger size than a metadata table 104 including all possible pair combinations. Both metadata tables 104 may have equivalent recovery performance.

The server representations appearing at intersections of indices 302 with first server replica column 304, second server replica column 306, and third server replica column 308 may be the same sort of server representations discussed above with regard to FIG. 2.

In various embodiments, larger combinations of servers 108 may be utilized in metadata tables 104, such as quadruplet combinations, quintuplet combinations, etc. With these larger combinations, additional columns will be used in the metadata table 104 to ensure that each server 108 appearing in a combination appears in one of the columns. Thus, with quintuplet combinations, the metadata table 104 will include at least five columns.

FIG. 4 illustrates a flowchart of example operations of the metadata table generation module 110 for generating a metadata table 104 and of the transmission module 114 for providing that metadata table 104 to clients 106 or servers 108, in accordance with various embodiments. As illustrated at block 402, the metadata table generation module 110 determines the number of indices that are to appear in the metadata table 104. The metadata table generation module 110 may determine the number of indices based on a number of factors, including at least the total number of servers 108 in the system 100, a targeted number of server replicas, such as the server pairs or server triplets described and shown in FIGS. 2 and 3, a targeted data type of the indices (binary numbers or integers), and plans for growth of the number of servers 108 included in the system 100. The targeted length, targeted data type, and growth plans may be provided by an operator or other computer system and stored in the table data 112.

In some embodiments, where the targeted length of the server combinations is two, the metadata table generation module 110 calculates the number of possible combinations as follows:

${C = \frac{n\left( {n - 1} \right)}{2}}\;$

where C is the number of possible server combinations and n is the total number of servers 108 in the system 100. In other embodiments, where the targeted length of the server combinations is three, the metadata table generation module 110 calculates the number of possible combinations as follows:

$C = \frac{{n\left( {n - 1} \right)}\left( {n - 2} \right)}{6}$

where C is the number of possible server combinations and n is the total number of servers 108 in the system 100. In various embodiments, for various targeted lengths of the server combinations, the metadata table generation module 110 may calculate the number of possible combinations as follows:

${{}_{}^{}{}_{}^{}} = \frac{n!}{{\left( {n - k} \right)!}{k!}}$

where C is the number of possible server combinations, n is the total number of servers 108 in the system 100, and k is the targeted length of the server combinations. The above two rules for targeted lengths of two and three are special cases of this general rule.

In some embodiments, as mentioned above, servers 108 may belong to failure domains, and the metadata table generation module 110 may exclude combinations of servers that include multiple servers 108 from a given failure domain. In such embodiments, the number of possible combinations of servers 108 will be less than the numbers calculated above. For example, instead of using the total number of servers 108 for n, the total number of failure domains may be used instead, determining unique combinations of failure domains, with one server from each failure domain. Such embodiments may involve the use of multiple metadata tables 104, such as a failure domain table that includes representations of failure domains in place of server presentations and an intra-domain table that specifies which server 108 in each failure domain is associated with each index. Failure domains and servers 108 may be mapped to one another using an additional table stored in table data 112.

Upon determining the length of the possible server combinations, the metadata table generation module 110 may determine if binary numbers are used for the indices. As mentioned above, to specify all possible binary numbers of a given length, binary numbers in a power of two will be generated. This in turn means that the number of indices must be a power of two. Accordingly, at block 404, if binary number indices are to be used in the metadata table 104 and if the number of combinations of servers 108 is not a power of two, the metadata table generation module 110 may increase the number of indices from the number of combinations of servers 108 to the nearest power of two.

Further, at block 404, the metadata table generation module 110 may increase the number of indices to account for growth plans. Increasing the number of indices to account for growth plans may involve multiplying the number of server combinations by a constant multiplier (e.g., multiply by two, three, etc.). In such embodiments, the metadata table generation module 110 multiplies the number of server combinations by the multiplier, which may be found in the table data 112, and increases the result to the nearest power of two if the indices are to be binary numbers. The result of the determining at block 402 and the increasing at block 404 may be the number of indices used in the metadata table 104. In other embodiments, the number of indices may simply be stored in and retrieved from the table data 112.

At block 406, the metadata table generation module 110 generates the indices based on the targeted data type of the indices found in the table data 112. If the targeted data type is binary numbers, then the metadata table generation module 110 may utilize the determined number of indices to determine the length of the binary numbers. As mentioned, with binary number indices, the determined number of indices is a power of two. The metadata table generation module 110 may determine what that power is and set the bit length of the indices to that power. For example, if the determined number of indices is thirty-two, the metadata table generation module 110 may determine that thirty-two is two to the fifth power and set the bit length to five. The metadata table generation module 110 then generates all possible binary numbers of that bit length and uses those binary numbers as the indices. If the targeted data type is integers, then the metadata table generation module 110 may generate all possible integers from zero to one less than the determined number of indices and use those integers as the indices.

At block 408, the metadata table generation module 110 may determine the possible combinations of servers 108. In various embodiments, the metadata table generation module 110 may determine the possible combinations of servers 108 by retrieving the targeted length of the server combinations from the table data 112, by retrieving representations of all of the servers 108, and by enumerating the possible combinations of the servers 108. The metadata table generation module 110 may retrieve the server representations, for example, from a data structure stored in the table data 112, such as the above-described mapping of server IP addresses to smaller representations. Upon retrieving representations for servers 108, the metadata table generation module 110 begins generating combinations of those representations of the targeted combination length. In enumerating the combinations, the order in which the server representations appear in a given combination may be not be important. Any combination that has the same server representations—in any order—as a previously enumerated representation, is rejected. The result of these operations may be a set of combinations of server representations, the combinations being unique with respect to one another.

At block 408 a, the metadata table generation module 110 may account for failure domains in generating the possible server combinations. As described above, the metadata table generation module 110 may do this by utilizing representations of failure domains in place of representations of servers 108. The unique combinations would then be unique combinations of failure domains. After generating the unique combinations of failure domains, the metadata table generation module 110 may randomly or pseudo-randomly select a server 108 from each failure domain in a combination.

At block 410, the metadata table generation module 110 associated the possible server combinations with the indices. If the number of combinations and number of indices are identical, then one combination is associated with each index. If the number of indices is greater than the number of combinations, then the metadata table generation module 110 may first associate each combination to one of the indices. The metadata table generation module 110 may then select a combination randomly or pseudo-randomly from the possible combinations and associate that combination with an index that did not have a combination associated with it in the first round of associations. In randomly or pseudo-randomly selecting combinations to associate with indices, the metadata table generation module 110 may ensure that no combination is associated with three indices until all combinations are each associated with two indices.

At block 412, the metadata table generation module 110 may determine the number of additional servers to associate with each index. That number may be the same for all indices and may be based on a targeted durability of the data stored by servers 108 of the system 100 and on a targeted length of the combinations, the targeted durability and targeted length retrieved from the table data 112. For example, if the targeted durability specifies four concurrent server failures as the tolerable limit for data loss and the targeted length of the combinations is two, then the metadata table generation module 110 may determine that two additional servers 108 should be associated with each index to ensure that each index is associated with four different servers 108.

At block 414, the metadata table generation module 110 randomly or pseudo-randomly selects the additional servers to associate with each index. Pseudo-random selection may be based on a pseudo-random seed retrieved by the metadata table generation module 110 from the table data 112. The pseudo-random seed is used by a pseudo-random number generator to generate a number that is used in pseudo-randomly selecting an additional server 108. Upon randomly or pseudo-randomly selecting an additional server 108 for an index, the metadata table generation module 110 compares the randomly/pseudo-randomly selected additional server 108 to the servers 108 already associated with an index. If the additional server 108 is already associated with a given index, then the metadata table generation module 110 randomly or pseudo-randomly selects a different additional server 108, ensuring that no server 108 is twice associated with a same index. At block 416, these selected additional servers are then associated with their respective indices.

At block 418, the metadata table generation module 110 generates the metadata table 104. The metadata table generation module 110 may generate the metadata table 104 incrementally while performing operations 402-416, or may do so upon completion of operations 402-416. If generating the metadata table 104 upon completion of operations 402-416, the metadata table generation module 110 may retrieve the generated indices and the servers 108 associated with each index from, for example, one or more data structures of the metadata table generation module 110 that store the indices, the server representations, and the associations of servers 108 with indices. In some embodiments, the metadata table generation module 110 may generate a row for each index and a column for each server replica. The number of columns may correspond to the number of servers 108 associated with each index. The metadata table generation module 110 may store representations of the servers 108 associated with each index in intersections of the columns with the row corresponding to that index. In other embodiments, indices may correspond to columns and server replicas 108 to rows. The metadata table generation module 110 may then store the generated metadata table 104 on the metadata server 102 or on some other device and may notify the transmission module 114 that a metadata table 104 has been generated.

At block 420, the transmission module 114 transmits the metadata table 104 to clients 106 or servers 108. In some embodiments, the transmission module 114 transmits the metadata table 104 to all clients 106 and servers 108 in the system 100. In other embodiments, the transmission module 114 transmits the metadata table 104 to a subset of the clients 106 and/or servers 108, the subset specified, for example, in the table data 112.

At block 422, the metadata table generation module 110 updates the metadata table 104 in response to a server failure. The metadata server 102 may determine occurrence of a server failure by receiving notification of the failure from a client 106 or server 108 or by failing to receive a “heartbeat” message that servers 108 are configured to periodically transmit to the metadata server 102. If a server 108 does not transmit a heartbeat message in a specified amount of time, the metadata server 102 may determine that a failure has occurred. Upon determining the occurrence of a failure, the metadata server 102 may notify the metadata table generation module 110 of the failure and of the identity of the server 108 that has failed. Upon receiving this notification, the metadata table generation module 110 may determine entries in the metadata table 104 that correspond to the failed server 108 and may replace the representations of the failed server with representations of other servers 108. The metadata table generation module 110 may randomly or pseudo-randomly select a replacement server 108 for each row that includes a failed server 108, also ensuring that the randomly or pseudo-randomly selected replacement server 108 is not the failed server 108 and is not already included in that row. Upon generating the updated metadata table 104, the metadata server 102 may instruct the other servers 108 in a row that includes a replacement server 108 to write data items associated with the index that corresponds to the row to that replacement server 108.

At block 424, the transmission module 114 transmits the updated metadata table 104 to clients 106 and/or servers 108. In some embodiments, the transmission module 114 transmits only the rows of the metadata table 104 that have been updated. In other embodiments, the transmission module 114 transmits only the changed entries of the metadata table 104 along with the row and column that each entry corresponds to in order to enable the clients 106 and/or servers 108 to generate the updated metadata table 104.

Example Rules and Techniques for Their Utilization

FIG. 5 illustrates a flowchart of example operations of a virtual table module 116 for utilizing one or more rules 104 defining a virtual metadata table to identify servers 108 associated with an index that corresponds to one or more data items 124, in accordance with various embodiments. As illustrated at block 502, the virtual table module 116 may receive rules 104 or parameters for rules 104 from the metadata server 102. In various embodiments, parameters alone may be transmitted when the virtual table module 116 is already configured to include the rules 104. The parameters may include, for example, the total number of servers 108 in the system 100, the number of possible indices, the targeted number of server replicas, mappings of server IP addresses to smaller representations, mapping of server representations or server IP addresses to failure domain representations, and a pseudo-random seed. The rules 104 may be one or more algorithms, formulas, or modules taking the parameters, an index, and optionally, a choice of server replica groups as inputs and producing identifications of one or more server replicas 108 as outputs. The rules 104 are said to define a virtual metadata table because the outputs, along with their correlations to indices and choices of server replica groups (e.g., the second server replica group as represented by the second column in a metadata table 104), may be collectively organized into a metadata table 104.

At block 504, the virtual table module 116 may optionally generate a metadata table using the rules 104. As mentioned, the collective outputs of the rules 104 and their associations to indices and server replica groups may form a metadata table 104. To generate the metadata table 104, the virtual table module 116 provides each possible pair of an index and a server replica group (the equivalent of each pair of a row and a column) to the rules 104 and includes the output as the intersection of row for that index and a column for that server replica group. The output is an integer representation of a specific server replica 108 or of a specific failure domain that may be used along with the above mentioned mappings to identify server IP addresses for further use by the client 106 or server 108 associated with the virtual table module 116.

At block 506, the virtual table module 116 receives or determines an index as part of a request for one or more server identifications from the client 106 or server 108 that includes the virtual table module 116. In addition to the index, the request may also include an identification of one or more server replica groups. In some embodiments, the index provided may be a binary number. In such embodiments, the virtual table module 116 may perform a mod operation on the received index, using the total number of indices to appear in the table as the divisor. The output of the mod operation will be an integer between zero and one less than the total number of indices. That integer is used in place of the binary number index received in the request. In other embodiments, the virtual table module 116 may provide the total number of indices to the client 106 or server 108 that includes the virtual table module 116 in order to enable the client 106 or server 108 to generate the integer index and provide it in the request. The total number of indices may be a function of the rules 104 utilized or may be determined at the metadata server 102 using the above-described techniques for determining the total number of indices and provided to the virtual table module 116 as a parameter.

At block 508, the virtual table module 116 utilizes the index, parameters, and optionally, server replica group as inputs to one or more formula in order to determine identities of servers 108 associated with the index and server replica groups. In various embodiments, any number of rules 104 may be used. The rules 104 may require that no index be associated with the same server 108 in two or more server replica groups. In some embodiments, this requirement is extended to failure domains, requiring that no index be associated with the same failure domain two or more times. Further, the rules 104 may require that the data 124 stored on one server 108 be evenly distributed over the other servers 108 in the system, ensuring that those other servers 108 participate in recovery in the event of the failure of that server 108.

In some embodiments, the rules 104 may define a virtual metadata table with three server replica groups (i.e., three column equivalents). Those rules 104 may include the following formulas:

f(1,r)=floor(r/n)

f(2,r)=(r+f(1,r))

f(3,r)=(f(1,r)+f(2,r))

In these formulas, r represents the index and n represents the total number of servers 108 in the system 100. f(1, r) represents the identity of the server 108 belonging to the first replica group that is associated with the index r. f(2, r) represents the identity of the server 108 belonging to the second replica group that is associated with the index r. f(3, r) represents the identity of the server 108 belonging to the third replica group that is associated with the index r. If the request received by the virtual table module 116 specified a server replica group (e.g., the second server replica group), then only the formula corresponding to that group (e.g., second formula (f(2, r))) would be used. If the request not does specify a server replica groups, then the virtual table module 116 may determine identifies of servers 108 for each of the server replica groups given the index r. In some embodiments, these formulas may produce illegitimate results, such as a multiple identifications of a same server 108 (or different servers 108 from a same failure domain) for a same index. For example, given the index r=1, the formulas produce the following identifications: 0, 1, 1. Thus, the server representation 1 is associated with the index 1 twice. In such embodiments, the index r may be input into a pseudo-random function that, using the pseudo-random seed, replaces index r with an index r′. The virtual table module 116 may then use index r′, and return its identified servers 108 as the output of rules 104. If r′ also generates illegitimate results, then the virtual table module 116 may generate a further replacement index r″, and so on.

In other embodiments, different rules 104 may define a different virtual metadata table. Such different rules 104 may utilize a prime number n as the total number of servers 108 in the system 100, may utilize n server replica groups, and may utilize n²−n indices. Such different rules 104 may correspond to a number of different non-constant arithmetic progressions input to mod operations that use n as the divisor. For example, the rules 104 may correspond to the following formula:

f=(((1+floor(r/n))*c)+r)mod n

In this formula, r is an index between 0 and n²−n−1, c is a server replica group between 0 and n−1, and f is an identified server 108. If the request received by the virtual table module 116 specified a server replica group (e.g., the second server replica group), then only the value of c corresponding to that group (e.g., c=1) would be used. If the request not does specify a server replica groups, then the virtual table module 116 may determine identifies of server 108 for each of the server replica groups c given the index r. If each server replica 108 for an index r is identified, then the rules 104 return n identified servers 108. In some embodiments, the virtual table module 116 may reserve one or more of these server replica groups as recovery servers 108 to be used in the event of server failure. In such embodiments, the virtual table module 116 may return only the first m of the identified servers 108 or may simply use the rules 104 to determine identified servers 108 for c=0 through m=−1, m being some number less than n. For example, m may be three server replica groups and n may be five total server replica groups, thus leaving the fourth and fifth server replica groups available for recovery.

In various embodiments, the virtual table module 116 may account for failure domains by using the outputs of the rules 104 as failure domain identifiers rather than server identifiers. In such embodiments, upon identifying the failure domain identifiers, the virtual table module 116 may utilize the mappings of failure domains to servers 108 and a pseudo-random seed to select one of the servers 108 in the mappings for each identified failure domain. For example, the virtual table module 116 may determine the number of entries in the mappings for an identified failure domain and perform a mod operation on the index r using that number of identified failure domain entries as the divisor. A number between 0 and one less than the number of identified failure domain entries will be returned by the mod operation. The virtual table module 116 may then select the server 108 corresponding p^(th) identified failure domain entry, p being the output of the mod operation and counting the first such entry as p=0. The selected servers 108 for the identified failure domains may then be returned by the virtual table module 116 as results.

At block 510, the virtual table module 116 may determine a replacement server 108 in the event of server failure. As mentioned above, the one or more rules 104 may include server replica groups that are reserved by the virtual table module 116 for recovery. In the event of server failure, the virtual table module 116 utilizes the identity of the failed server (which may be received from the metadata server 102, a client 106, or a server 108) as input to the rules to determine the indices r associated with the failed server. The virtual table module 116 may then identify servers 108 in the first of the reserved server replica groups that correspond to the indices r and use those identified servers 108 in place of the failed server. In other embodiments, the virtual table module 116 may receive updated rules 104 and/or updated parameters for rules 104 responsive to a server failure and may utilize those updated rules 104 and/or parameters going forward.

Example Computer System Architecture

FIG. 6 illustrates a block diagram showing components of a computer system 600 such as a metadata server 102, a client 106 or a server 108, in accordance with various embodiments. In various embodiments, computer system 600 may include at least one processing unit 602. The processing unit 602 may be any sort of processing unit. The processing unit 602 may also or alternatively include one or more graphic processing units (GPUs).

System memory 604 of the computer system 600 may store program instructions that are loadable and executable on the processor(s) 602, as well as data generated during the execution of these programs. Depending on the configuration and type of computing device, system memory 604 may be volatile (such as random access memory (RAM)) and/or non-volatile (such as read-only memory (ROM), flash memory, etc.). The computer system 600 may also include additional removable storage 612 and/or non-removable storage 614 including, but not limited to, magnetic storage, optical disks, and/or tape storage. The disk drives and their associated computer-readable media may provide non-volatile storage of computer readable instructions, data structures, program modules, and other data for the computing devices. In some implementations, the system memory 604 may include multiple different types of memory, such as static random access memory (SRAM), dynamic random access memory (DRAM), or ROM. In embodiments in which the computing device 600 is a server 108, the storage 126 of the server 108 may be any one or more of the system memory 604, removable storage 612, or non-removable storage 614.

Computer-readable media includes, at least, two types of computer-readable media, namely computer storage media and communications media.

Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computing device. System memory 604, removable storage 612, and non-removable storage 614 are examples of computer storage media.

In contrast, communication media may embody computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave, or other transmission mechanism. As defined herein, computer storage media does not include communication media.

As further shown in FIG. 6, the system memory 604 may store an operating system 606, program modules 608, and program data 610. The operating system 606 may be any sort of operating system or operating systems known in the art. The program modules 608 and program data 610 may include any one or more of the tables/rules 104, the metadata table generation module 110, the table data 112, the transmission module 114, the virtual table module 116, the client library 118, or the data 124, these components being described above in greater detail.

Computer system 600 may also have input device(s) 616 such as a keyboard, a mouse, a touch-sensitive display, voice input device, etc. Output device(s) 618 such as a display, speakers, a printer, etc. may also be included. These devices are well known in the art and need not be discussed at length here.

Computer system 600 may also contain communication connections 620 that allow the device to communicate with other computing devices 622. The communication connections 620 are implemented at least partially by network interface components. The other computing devices 622 may be any of the metadata server 102, the clients 106, or the servers 108. For example, the metadata server 102 may be a computing system 600 and a client may be another computing device 622 which communicates with the metadata server 102 using the communication connections 620.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing the claims. 

1. One or more computer storage media comprising computer-executable instructions stored thereon and configured to program a metadata server to perform operations including: generating a metadata table for a system, the generating including: determining a number of indices to include in the metadata table based at least on a number of servers in the system; associating each possible pair of the servers with one of the indices; and associating one or more additional ones of the servers with each index; and providing the metadata table to one or more clients or servers of the system.
 2. The one or more computer storage media of claim 1, wherein the operations further include randomly selecting or pseudo-randomly selecting the one or more additional servers for each index.
 3. The one or more computer storage media of claim 1, wherein the number of additional servers associated with each index is the same for all indices and is selected based on a targeted durability of data stored in the system.
 4. The one or more computer storage media of claim 1, wherein the indices are prefixes included in fixed-length translations of tract identifiers or are remainders generated by mod operations performed on the prefixes, the fixed-length translations, or the tract identifiers.
 5. The one or more computer storage media of claim 1, wherein the determining comprises determining the number of possible pairs of the servers in the system and setting the number of indices to the number of possible pairs of the servers.
 6. The one or more computer storage media of claim 5, wherein the operations further include: increasing the number of indices to a nearest power of two; or increasing the number of indices by a multiplier to allow for growth of the number of servers in the system while minimizing changes to the metadata table.
 7. The one or more computer storage media of claim 1, wherein the operations further include updating the servers associated with one or more of the indices in response to failure of a server.
 8. The one or more computer storage media of claim 7, wherein the providing comprises providing only metadata table entries corresponding to indices that have had one or more of their associated servers changed.
 9. The one or more computer storage media of claim 1, wherein the operations further include associating server representations with the indices, the server representations being compact representations associated with addresses of the servers by an additional table of the metadata server.
 10. The one or more computer storage media of claim 1, wherein each server is associated with a failure domain and the associating each possible pair of the servers with one of the indices comprises combining each server with every other server that is not in the failure domain of that server.
 11. A method comprising: receiving, by a computing device, at least one of a total number of servers in a system and one or more rules defining a virtual metadata table of the system; and determining, by the computing device, identities of a subset of the servers by utilizing at least an index to the virtual metadata table, the index associated with one or data items stored on the subset of the servers, and the total number of servers in the system as inputs to the one or more rules defining the virtual metadata table.
 12. The method of claim 11, further comprising receiving from a metadata server of the system at least one of the total number of servers in the system or the one or more rules defining the virtual metadata table.
 13. The method of claim 11, wherein the determining further involves utilizing at least one of a specific number of servers included in the subset of servers, a number of failure domains in the system or a pseudo-random seed as inputs to the one or more rules.
 14. The method of claim 11, wherein the determining includes generating a metadata table corresponding to the virtual metadata table and locating the index in the metadata table.
 15. The method of claim 11, further comprising determining a replacement server in the event of a server failure based on the one or more rules or based on one or more replacement rules generated responsive to the server failure.
 16. The method of claim 11, wherein the rules include formulas, those formulas being: f(1,r)=floor(r/n) f(2,r)=(r+f(1,r)) f(3,r)=(f(1,r)+f(2,r)) wherein r is the index, n is the total number of servers in the system, f(1, r) is a first identified server of the subset of servers, f(2, r) is a second identified server of the subset of servers, f(3, r) is a third identified server of the subset of servers, and both the indices and the servers of the subset of servers are integers.
 17. The method of claim 11, wherein in the rules include non-constant arithmetic progressions input to mod operations using the total number of servers in the system as the divisor.
 18. The method of claim 11, wherein the servers in the system are virtual servers.
 19. A metadata server comprising: a processor; a metadata table generation module configured to be operated by the processor to generate a metadata table for a system, the generating including determining a number of indices to include in the metadata table based on a number of possible combinations of the servers in the system and associating each of the possible combinations of the servers with one of the indices, each of the possible combinations involving a predetermined number of the servers; and a transmission module configured to be operated by the processor to provide the metadata table to one or more clients or servers.
 20. The system of claim 19, wherein the metadata table is used by the clients to identify servers for performing at least one of opening byte sequences, requesting allocation of tracts, deleting byte sequences, writing tracts, or reading tracts. 